package api.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2017/9/6.
 */

@Controller
@RequestMapping("test")
public class DemoController {

    @RequestMapping(value = "/hello", method = RequestMethod.GET,produces="application/json;charset=UTF-8")
    @ResponseBody

    public Map hello() {

        Map map = new HashMap();

        map.put("msg", "请求成功");

        map.put("data", "浪漫恋星空");
        return map;
    }

}
